﻿/**
 * Peter
 * Created by: Peter Development Team
 *    http://peter.codeplex.com/
 * 
 * GNU General Public License version 2 (GPLv2)
 *    http://peter.codeplex.com/license
 *
 *  This code is provided on an AS IS basis, with no WARRANTIES,
 *  CONDITIONS or GUARANTEES of any kind.
 *
 **/

using System.Collections.Generic;
using System.Reflection;
using ICSharpCode.AvalonEdit.CodeCompletion;
using ICSharpCode.AvalonEdit.Document;

namespace Peter.Common.Code
{
   /// <summary>
   /// Represents the result of code completion.
   /// </summary>
   public class CodeCompletionResult
   {
      /// <summary>
      /// Gets the list of completion items.
      /// </summary>
      public List<ICompletionData> CompletionData = new List<ICompletionData> ();

      /// <summary>
      /// Gets suggested completion data.
      /// </summary>
      public ICompletionData SuggestedCompletionDataItem;

      /// <summary>
      /// Gets the length of the trigger word.
      /// </summary>
      public int TriggerWordLength;

      /// <summary>
      /// Gets the trigger word.
      /// </summary>
      public string TriggerWord;

      /// <summary>
      /// Gets the overload provider.
      /// </summary>
      public IOverloadProvider OverloadProvider;
   }

   public interface ICompletion
   {
      void AddReferences (params Assembly[] references);
      void RemoveReferences (params Assembly[] references);
      void AddReferences (params string[] references);
      void RemoveReferences (params string[] references);

      //void SetVariables(string[] variables);
      //void ProcessExecution(string script, string file);

      CodeCompletionResult GetCompletions (IDocument document, int offset, bool controlSpace = false, string[] namespaces = null);
      ICompletion Clone (bool isRepl = false);
   }
}
